r = [{'faceId': 'b7303651-34d2-4550-a140-775759745a4e',
  'faceRectangle': {'top': 102, 'left': 444, 'width': 108, 'height': 108},
  'faceAttributes': {'smile': 0.07,
   'gender': 'male',
   'age': 29.0,
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.0,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 0.07,
    'neutral': 0.93,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.18},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.63},
   'noise': {'noiseLevel': 'medium', 'value': 0.32},
   'makeup': {'eyeMakeup': True, 'lipMakeup': True},
   'accessories': [],
   'hair': {'bald': 0.06,
    'invisible': False,
    'hairColor': [{'color': 'brown', 'confidence': 0.99},
     {'color': 'black', 'confidence': 0.94},
     {'color': 'blond', 'confidence': 0.28},
     {'color': 'gray', 'confidence': 0.18},
     {'color': 'other', 'confidence': 0.09},
     {'color': 'red', 'confidence': 0.08},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': '5c41a75a-c299-4a4e-ad4f-f5d506203ec6',
  'faceRectangle': {'top': 87, 'left': 119, 'width': 97, 'height': 97},
  'faceAttributes': {'smile': 0.903,
   'gender': 'female',
   'age': 25.0,
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.001,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 0.903,
    'neutral': 0.097,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.17},
   'exposure': {'exposureLevel': 'overExposure', 'value': 0.8},
   'noise': {'noiseLevel': 'medium', 'value': 0.41},
   'makeup': {'eyeMakeup': True, 'lipMakeup': True},
   'accessories': [],
   'hair': {'bald': 0.17,
    'invisible': False,
    'hairColor': [{'color': 'blond', 'confidence': 0.99},
     {'color': 'brown', 'confidence': 0.88},
     {'color': 'red', 'confidence': 0.57},
     {'color': 'gray', 'confidence': 0.26},
     {'color': 'other', 'confidence': 0.14},
     {'color': 'black', 'confidence': 0.01},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': 'f3e286dc-3071-47e7-b944-8f671baa357d',
  'faceRectangle': {'top': 222, 'left': 256, 'width': 88, 'height': 88},
  'faceAttributes': {'smile': 1.0,
   'gender': 'female',
   'age': 18.0,
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.0,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 1.0,
    'neutral': 0.0,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.0},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.59},
   'noise': {'noiseLevel': 'medium', 'value': 0.48},
   'makeup': {'eyeMakeup': True, 'lipMakeup': True},
   'accessories': [],
   'hair': {'bald': 0.08,
    'invisible': False,
    'hairColor': [{'color': 'black', 'confidence': 0.98},
     {'color': 'brown', 'confidence': 0.93},
     {'color': 'gray', 'confidence': 0.48},
     {'color': 'other', 'confidence': 0.22},
     {'color': 'blond', 'confidence': 0.13},
     {'color': 'red', 'confidence': 0.04},
     {'color': 'white', 'confidence': 0.0}]}}}]

# 创建字典
glasses = {}
smile = {}
hairColor = {}
age = {}
gender = {}

# 把所有人脸的值添加进字典
count = 0
while count < len(r):
    glasses["Person{}".format(count + 1)] = r[count]['faceAttributes']['glasses']
    smile["Person{}".format(count + 1)] = r[count]['faceAttributes']['smile']
    hairColor["Person{}".format(count + 1)] = r[count]['faceAttributes']['hair']['hairColor'][0]['color']
    age["Person{}".format(count + 1)] = r[count]['faceAttributes']['age']
    gender["Person{}".format(count + 1)] = r[count]['faceAttributes']['gender']
    count += 1

# 打印字典
print("眼镜：", glasses)
print("微笑指数：", smile)
print("头发颜色：", hairColor)
print("年龄：", age)
print("性别：", gender)

# 眼镜： {'Person1': 'NoGlasses', 'Person2': 'NoGlasses', 'Person3': 'NoGlasses'}
# 微笑指数： {'Person1': 0.07, 'Person2': 0.903, 'Person3': 1.0}
# 头发颜色： {'Person1': 'brown', 'Person2': 'blond', 'Person3': 'black'}
# 年龄： {'Person1': 29.0, 'Person2': 25.0, 'Person3': 18.0}
# 性别： {'Person1': 'male', 'Person2': 'female', 'Person3': 'female'}